var ControlToSet;
var theForm = document.theForm;
var CalWidth=180;
var StartYear = "";
var EndYear = "";
var FormatAs;
var NN4 = (navigator.appName.indexOf("Netscape")>=0 && !document.getElementById)? true : false;
var NN6 = (document.getElementById && navigator.appName.indexOf("Netscape")>=0 )? true: false;
var TOP;
var LEFT;
var minDate;

if(NN4)document.captureEvents(Event.MOUSEMOVE);

document.onmousemove = LogPosition;

function LogPosition(evt){

    if (NN4||NN6){
    LEFT=evt.screenX;
    TOP=evt.screenY-10;
    }
    else{
    LEFT=event.screenX;
    TOP=event.screenY-10;
    }

}

function ShowCalendarDisableDate(CONTROL,START_YEAR,END_YEAR,FORMAT,MIN_DATE)
{
	var dd = parseInt(MIN_DATE.substring(0,2),10);
	var mm = parseInt(MIN_DATE.substring(3,5),10);
	var yy = parseInt(MIN_DATE.substring(6,10),10);
	new Date(yy,mm-1,dd);
	minDate = MIN_DATE;
	ControlToSet = eval(CONTROL);
	StartYear = START_YEAR;
	EndYear = END_YEAR;
	FormatAs = FORMAT;

	var strFeatures = "width=" + CalWidth + ",height=140" + ",left=" + LEFT + ",top=" + TOP;
	var CalWindow = window.open("/jsp/HTMLCalendar.htm","Calendar", strFeatures)
	CalWindow.focus();
	} //End Function

	function ShowCalendar1(CONTROL,START_YEAR,END_YEAR,FORMAT,SURL){
	ControlToSet = eval(CONTROL);
	StartYear = START_YEAR;
	EndYear = END_YEAR;
	FormatAs = FORMAT;
	url=SURL+'/jsp/HTMLCalendar.htm';

	var strFeatures = "width=" + CalWidth + ",height=140" + ",left=" + LEFT + ",top=" + TOP;
	var CalWindow = window.open(url,"Calendar", strFeatures)
	CalWindow.focus();
}
function ShowCalendar(CONTROL,START_YEAR,END_YEAR,FORMAT){	
minDate= "none";
ControlToSet = eval(CONTROL);
StartYear = START_YEAR;
EndYear = END_YEAR;
FormatAs = FORMAT;

var strFeatures = "width=" + CalWidth + ",height=140" + ",left=" + LEFT + ",top=" + TOP;
var CalWindow = window.open("/jsp/HTMLCalendar.htm","Calendar", strFeatures)
CalWindow.focus();
} //End Function

function ShowCalendar1(CONTROL,START_YEAR,END_YEAR,FORMAT,SURL){
ControlToSet = eval(CONTROL);
StartYear = START_YEAR;
EndYear = END_YEAR;
FormatAs = FORMAT;
url=SURL+'/jsp/HTMLCalendar.htm';

var strFeatures = "width=" + CalWidth + ",height=140" + ",left=" + LEFT + ",top=" + TOP;
var CalWindow = window.open(url,"Calendar", strFeatures)
CalWindow.focus();
}

function SetDate(DATE){
	if(ControlToSet){
		ControlToSet.value = DATE;
	}
	ControlToSet = null;
	StartYear = null;
	EndYear = null;
	FormatAs = null;
}